home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
comm
/
news
/
nta_11ld.lha
/
Next_to_Active
/
next2active.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-07-15
|
2KB
|
81 lines
/*
Updates UULIB:Active's top article number based on the ".next" files.
Quickly slapped together by Leo Davidson <leo@hampschl.demon.co.uk>
("Nudel" in #Amiga on IRC)
You may do whatever you like with this script, so long as it does not harm
anyone, :-).
*/
ActivePath = "UULIB:Active"
Say
Say " p
Next-to-Active 1.1
by Leo Davidson (IRC:
Nudel
, Pot-Noodle/Gods'Gift)"
Say "
EMail:
leo@hampschl.demon.co.uk if you have any problems or comments."
Address Command "Copy "||ActivePath||" "||ActivePath||".bak"
IF ~OPEN(ActiveFile,ActivePath,"R") THEN DO
Say "Next2Active: -ABORTED- Couldn't open active file."
EXIT
END
Say "
.---------------------------------------------------------------------."
Say "
|
Group Name
|
Low
|
High
|
Total
|"
Say "
|---------------------------------------------------------------------|
"
grand_total = 0
x = 0
Do While ~EOF(ActiveFile)
x = x + 1
TempErp = ReadLn(ActiveFile)
If TempErp ~= "" Then Do
group.x = Word(TempErp,1)
group_next.x = "UUNews:"||Translate(Word(TempErp,1),"/",".")||"/.next"
/* high.x = Word(TempErp,2) */
low.x = Word(TempErp,3)
type_thingy.x = Word(TempErp,4)
IF ~Open(next_file,group_next.x,"R") THEN
high.x = "0"
ELSE Do
high.x = Word(ReadLn(next_file),1)
Close(next_file)
END
IF ~Datatype(high.x,"N") THEN DO
Say " pNext2Active: -ABORTED- Invalid file: '"||group_next.x||"' (Contents: '"||high.x||"'."
EXIT
END
total.x = high.x - low.x
grand_total = grand_total + total.x
Say "
|
"||Right(Group.x,40,".")||"
|
"||Right(low.x,6,".")||"
|
"||Right(high.x,6,".")||"
|
"||Right(total.x,6,".")||"
|
"
END
END
CLOSE(ActiveFile)
Say "
|---------------------------------------------------------------------|"
Say "
|
Writting new 'Active' file...
0%
[
------------------
]
100%
|
"||Right(grand_total,6,".")||"
|
"
Say "
`---------------------------------------------------------------------'
A"
IF ~OPEN(ActiveFile,ActivePath,"W") THEN DO
Say " pNext2Active: -ABORTED- Couldn't write new active file."
EXIT
END
Do y=1 to x-1
Say "C"||Copies("=",Trunc(18*(y/(x-1)),0))||"A"
WriteLn(ActiveFile,group.y high.y low.y type_thingy.y)
END
CLOSE(ActiveFile)
Say
Say
Say